﻿#include "FITKAcousticsAbsNCT.h"

namespace Acoustics
{

    FITKAcousticsAbsNCT::~FITKAcousticsAbsNCT()
    {
    }

    Acoustics::FITKAcousticsAbsNCT::NCTType FITKAcousticsAbsNCT::getNCTType()
    {
        //错误类型
        return NCTType::None;
    }

    QList<FITKAcousticsAbsNCT*> FITKAcousticsNCTManager::getAcousticsNCTByType(FITKAcousticsAbsNCT::NCTType t)
    {
        //返回值
        QList<FITKAcousticsAbsNCT*> ncts;
        const int n = this->getDataCount();
        //遍历对象
        for (int i=0;i<n; ++i)
        {
            FITKAcousticsAbsNCT* nct = this->getDataByIndex(i);
            //判断类型
            if (nct != nullptr && nct->getNCTType() == t)
                ncts.append(nct);
        }
        return ncts;
    }

    void FITKAcousticsAbsNCT::setColor(float r, float g, float b)
    {
        _color[0] = r;
        _color[1] = g;
        _color[2] = b;
    }

    void FITKAcousticsAbsNCT::getColor(float* rgb)
    {
        if (rgb == nullptr || _color == nullptr) return;

        for (int i = 0; i < 3; i++)
            rgb[i] = _color[i];
    }

}



